Data descriptor
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
top
In computing, a data descriptor is a structure containing information that describes data.
Data descriptors may be used in compilers,cite-ref-1[1] as a software structure at run time in languages like Adacite-ref-2[2] or PL/I, or as a hardware structure in some computers such as Burroughs large systems with their descriptors.
Data descriptors are typically used at run-time to pass argument information to called subroutines. OpenVMScite-ref-3[3] and Multicscite-ref-4[4] have system-wide language-independent standards for argument descriptors. Descriptors are also used to hold information about data that is only fully known at run-time, such as a dynamically allocated array.
Contents
• Examples
• See also
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Examples
The following descriptor is used by IBM Enterprise PL/I to describe a character string:cite-ref-5[5]
| byte offset | +0 | +1 | +2 | +3 |
|---|---|---|---|---|
| 0 | descriptor type | string type | (res) | flags |
| 4 | maximum string length | maximum string length | maximum string length | maximum string length |
• 'desc type' is 2 to indicate that this is an element descriptor rather than an array or structure descriptor.
• 'string type' indicates that this is a character or a bit string, with varying or non varying length. 2 indicates a non varying (fixed-length) character string.
• '(res)' is a reserved byte not used for character strings.
• 'maximum string length' is the actual length of the string for non varying strings, or the maximum length for varying strings.
dcl 1 array based aligned,
2 node_type bit(9) unaligned,
2 reserved bit(34) unaligned,
2 number_of_dimensions fixed(7) unaligned,
2 own_number_of_dimensions fixed(7) unaligned,
2 element_boundary fixed(3) unaligned,
2 size_units fixed(3) unaligned,
2 offset_units fixed(3) unaligned,
2 interleaved bit(1) unaligned,
2 c_element_size fixed(24),
2 c_element_size_bits fixed(24),
2 c_virtual_origin fixed(24),
2 element_size ptr unaligned,
2 element_size_bits ptr unaligned,
2 virtual_origin ptr unaligned,
2 symtab_virtual_origin ptr unaligned,
2 symtab_element_size ptr unaligned,
2 bounds ptr unaligned,
2 element_descriptor ptr unaligned;
dcl 1 bound based aligned,
2 node_type bit(9),
2 c_lower fixed(24),
2 c_upper fixed(24),
2 c_multiplier fixed(24),
2 c_desc_multiplier fixed(24),
2 lower ptr unaligned,
2 upper ptr unaligned,
2 multiplier ptr unaligned,
2 desc_multiplier ptr unaligned,
2 symtab_lower ptr unaligned,
2 symtab_upper ptr unaligned,
2 symtab_multiplier ptr unaligned,
2 next ptr unaligned;
See also
References
cite-note-22. ↑ citerefschonbergSchonberg, Ed. "Ada Compared with C++". The Advantages of Ada 95. Retrieved January 15, 2013.
cite-note-33. ↑ citerefhewlett-packardHewlett-Packard. "Chapter 7 OpenVMS Argument Descriptors". HP OpenVMS Systems Documentation. Retrieved July 11, 2020.
cite-note-44. ↑ citerefhoneywell-inc-1979Honeywell, Inc. (1979). Multics Programmers' Manual – Subsystem Writers' Guide (PDF). pp. 2–13-2–18.
cite-note-55. ↑ citerefibm-corporation2006IBM Corporation (2006). Enterprise PL/I for z/OSProgramming Guide (PDF). p. 385.
cite-note-66. ↑ citerefmit-honeywellMIT/Honeywell. "array.incl.pl1". Multics/ldd/include. Retrieved January 20, 2012.